package com.egg.auth.config;

import com.egg.auth.config.applet.WechatAppletConfig;
import com.egg.auth.config.user.account.UserAccountConfig;
import com.egg.common.spring.util.SpringContextUtil;

/**
 * 读取自定义配置
 *
 * @author east
 */
public class ReadConfig {

    /**
     * 获取密码盐值
     *
     * @return
     */
    public static String userAccountDefaultPassword() {
        try {
            UserAccountConfig configBean = SpringContextUtil.getBean(UserAccountConfig.class);
            return configBean.getDefaultPassword();
        } catch (Exception e) {
            return "";
        }
    }


    /**
     * 获取小程序APPID
     *
     * @return
     */
    public static String appletAppid() {
        try {
            WechatAppletConfig configBean = SpringContextUtil.getBean(WechatAppletConfig.class);
            return configBean.getAppid();
        } catch (Exception e) {
            return "";
        }
    }

    /**
     * 获取小程序秘钥
     *
     * @return
     */
    public static String appletAppsercret() {
        try {
            WechatAppletConfig configBean = SpringContextUtil.getBean(WechatAppletConfig.class);
            return configBean.getAppsercret();
        } catch (Exception e) {
            return "";
        }
    }

}